package com.jingxi.common.dto;

import lombok.Data;

@Data
public class R<T> {
    private int code;
    private String message;
    private T t;

    public static R okTip(String message){
        R<Object> ok = ok();
        ok.message = message;
        return ok;
    }

    public static<T> R<T> ok(T t){
        R<Object> ok = ok();
        ok.t = t;
        return (R<T>) ok;
    }

    public static<T> R<T> ok(){
        R<T> objectR = new R<T>();
        objectR.code = 200;
        objectR.t = null;
        objectR.message = "";
        return (R<T>) objectR;
    }
}
